package Gear;

import java.nio.file.FileSystems;
import java.nio.file.Path;

/**
 * Class which contains all working settings.
 *
 * @author Davi Mendes
 */
public class Settings {

    /**
     * Default host of the tracker.
     */
    private static final String DEFAULT_SERVER_HOST = "node1";

    /**
     * Default port which a server remains listening.
     */
    private static final int DEAFULT_SERVER_PORT = 9876;

    /**
     * Default port which a client works.
     */
    private static final int DEFAULT_PORT_TO_LISTEN = 9567;

    /**
     * Default shared folder directory.
     */
    private static final Path DEFUALT_GEAR_PATH = FileSystems.getDefault().getPath("/opt/grupo11");

    /**
     * Default buffer size to transmit files.
     */
    private static final int DEFAULT_BUFFER_SIZE = 1024;

    /**
     * Host of the tracker.
     */
    private final String serverHost;

    /**
     * Port which a server remains listening.
     */
    private final int serverPort;

    /**
     * Port which a client works.
     */
    private final int portToListen;

    /**
     * Shared folder directory.
     */
    private final Path gearPath;

    /**
     * Buffer size to transmit files.
     */
    private final int bufferSize;

    /**
     * Constructor;
     */
    public Settings() {

        this.serverHost = DEFAULT_SERVER_HOST;
        this.serverPort = DEAFULT_SERVER_PORT;
        this.portToListen = DEFAULT_PORT_TO_LISTEN;
        this.gearPath = DEFUALT_GEAR_PATH;
        this.bufferSize = DEFAULT_BUFFER_SIZE;
    }

    /**
     * Get tracker host.
     *
     * @return Tracker host.
     */
    public String getServerHost() {
        return serverHost;
    }

    /**
     * Get port which a server remains listening.
     *
     * @return Server port.
     */
    public int getServerPort() {
        return serverPort;
    }

    /**
     * Get port which a client works.
     *
     * @return Client port.
     */
    public int getPortToListen() {
        return portToListen;
    }

    /**
     * Get shared folder path.
     *
     * @return Shared folder path
     */
    public Path getGearPath() {
        return gearPath;
    }

    /**
     * Get buffer size to transfer files.
     *
     * @return Buffer size.
     */
    public int getBufferSize() {
        return bufferSize;
    }

}
